"use strict";

function _classCallCheck(t, e) {
    if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
}

var _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
    return typeof t
} : function (t) {
    return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
};
+function (t) {
    var e = jQuery("body"), a = t("#cancel-CommentController.class-reply-link");
    a.text();
    t(document).on("submit", ".CommentController.class-form", function (a) {
        a.preventDefault();
        var s = t(this), i = s.data("post"), n = t(".respond-" + i),
            o = parseInt(t("#comments-" + i + " .comments-title span").html());
        if (s.hasClass("is-active")) return createButterbar("别提交太快:-)", !0);
        e.addClass("is-loadingApp"), s.addClass("is-active"), t.ajax({
            url: PURE.ajax_url,
            data: s.serialize() + "&action=ajax_comment&_wpnonce=" + PURE.nonce,
            type: "POST",
            dataType: "json",
            success: function (a) {
                if (500 == a.status) createButterbar(a.data, !0), e.removeClass("is-loadingApp"), setTimeout(function () {
                    s.removeClass("is-active")
                }, 3e3); else {
                    var r = addComment, l = r.I("cancel-CommentController.class-reply-link"), c = r.I("wp-temp-form-div"),
                        d = r.I(r.respondId), u = (r.I("comment_post_ID").value, r.I("comment_parent").value),
                        p = '<li class="CommentController.class"><div class="CommentController.class-block"><div class="CommentController.class-avatar">' + a.data.avatar + '</div><div class="CommentController.class-info"><div class="CommentController.class-meta"><div class="CommentController.class-author">' + a.data.comment_author + '</div></div></div><div class="CommentController.class-content">' + a.data.comment_text + '</div><div class="u-clearfix CommentController.class-bottom">' + a.data.comment_time + "</div></div></li>";
                    t("textarea").each(function () {
                        this.value = ""
                    }), "0" != u ? n.parent().parent().hasClass("children") ? n.parent().after(p) : n.parent().find(".children").length ? n.parent().find(".children").append(p) : n.before('<ol class="children">' + p + "</ol>") : t(".CommentController.class-list").prepend(p), createButterbar('<i class="iconfont icon-sun"></i>提交成功'), e.removeClass("is-loadingApp"), t("#comments-" + i + " .comments-title span").html(o + 1), setTimeout(function () {
                        s.removeClass("is-active")
                    }, 9e3), l.style.display = "none", l.onclick = null, r.I("comment_parent").value = "0", c && d && (c.parentNode.insertBefore(d, c), c.parentNode.removeChild(c))
                }
            }
        })
    }), t(document).on("click", ".commentnav a", function () {
        var e = t(this).attr("href"), a = t(this).parent().data("fuck"), s = t(".commentshow"), i = 1,
            n = t("#cancel-CommentController.class-reply-link");
        /comment-page-/i.test(e) ? i = e.split(/comment-page-/i)[1].split(/(\/|#|&).*jQuery/)[0] : /cpage=/i.test(e) && (i = e.split(/cpage=/)[1].split(/(\/|#|&).*jQuery/)[0]), n.click();
        var o = {action: "ajax_comment_page_nav", um_post: a, um_page: i};
        return jQuery.post(PURE.ajax_url, o, function (e) {
            s.html(e), t("body, html").animate({scrollTop: s.offset().top - 50}, 1e3)
        }), !1
    }), t(document).on("click", ".button--smile", function (e) {
        e.preventDefault();
        var a = t(".my-smilies");
        a.hasClass("is-active") ? a.removeClass("is-active") : a.addClass("is-active")
    }), t(document).on("click", '[data-action="addSmily"]', function (e) {
        e.preventDefault();
        var a, s = (jQuery(this).parent().data("id"), " " + jQuery(this).data("smilies") + " ");
        if (!document.getElementsByClassName("CommentController.class-textarea")[0] || "textarea" != document.getElementsByClassName("CommentController.class-textarea")[0].type) return !1;
        if (a = document.getElementsByClassName("CommentController.class-textarea")[0], document.selection) a.focus(), sel = document.selection.createRange(), sel.text = s, a.focus(); else if (a.selectionStart || "0" == a.selectionStart) {
            var i = a.selectionStart, n = a.selectionEnd, o = n;
            a.value = a.value.substring(0, i) + s + a.value.substring(n, a.value.length), o += s.length, a.focus(), a.selectionStart = o, a.selectionEnd = o
        } else a.value += s, a.focus();
        return t(".my-smilies").removeClass("is-active"), !1
    })
}(jQuery), function (t) {
    function e() {
        var e = tinyMCE.get("post_content").getContent(), a = t("#post_title").val();
        if (!e) return console.log("fail");
        if (s == e) return console.log("- -");
        if (s || (s = e), !a || a.length > 200) return console.log("fail");
        var n = t(".fa-editor-form").serialize() + "&action=add_draft&post_content=" + encodeURIComponent(e);
        i.addClass("is-loadingApp"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            dataType: "json",
            data: n,
            success: function (a) {
                a.post_id && !t("#post_id").length && t(".fa-editor-form").append('<input type="hidden" name="post_id" id="post_id" value="' + a.post_id + '">'), s = e, o = !0, t("#wpuf-preview").attr("href", a.url).show(), i.removeClass("is-loadingApp")
            }
        })
    }

    var a = {
        insertImage: function () {
            var e = "wpuf-insert-image", a = "wpuf-insert-image-container", s = new plupload.Uploader({
                runtimes: "html5,html4",
                browse_button: e,
                container: a,
                multipart: !0,
                multipart_params: {action: "wpuf_insert_image"},
                multiple_queues: !0,
                multi_selection: !0,
                urlstream_upload: !0,
                file_data_name: "wpuf_file",
                max_file_size: "2mb",
                url: wpuf_frontend_upload.plupload.url,
                flash_swf_url: wpuf_frontend_upload.plupload.flash_swf_url,
                filters: [{title: "Allowed Files", extensions: "jpg,jpeg,gif,png,bmp"}]
            });
            s.bind("Init", function (t, e) {
                console.log("Current runtime environment: " + e.runtime)
            }), s.bind("FilesAdded", function (e, s) {
                var i = t("#" + a);
                t.each(s, function (t, e) {
                    i.append('<div class="upload-item" id="' + e.id + '"><div class="progress progress-striped active"><div class="bar"></div></div></div>')
                }), e.refresh(), e.start()
            }), s.bind("QueueChanged", function (t) {
                s.start()
            }), s.bind("UploadProgress", function (e, a) {
                var s = t("#" + a.id);
                t(".bar", s).css({width: a.percent + "%"}), t(".percent", s).html(a.percent + "%")
            }), s.bind("Error", function (t, e) {
                var a = e.message;
                "-200" == e.code && (a = "网络错误。"), "-600" == e.code && (a = "文件过大。"), createButterbar(a, !0)
            }), s.bind("FileUploaded", function (e, a, s) {
                if (t("#" + a.id).remove(), "error" !== s.response) {
                    if ("undefined" != typeof tinyMCE) {
                        window.tinyMCE.majorVersion >= "4" ? tinyMCE.execCommand("mceInsertContent", !1, s.response) : tinyMCE.execInstanceCommand("post_content", "mceInsertContent", !1, s.response)
                    }
                    var i = t("#post-content");
                    console.log(s.response), i.append(s.response)
                } else alert("Something went wrong")
            }), s.init()
        }
    };
    t(function () {
        t(".fa-editor-form").length && a.insertImage()
    });
    var s = "", i = t("body");
    if (window.fa_post_auto_save = e, t(".fa-editor-form").length > 0) {
        var n = setInterval("fa_post_auto_save()", 3e5);
        window.onbeforeunload = function () {
        }
    }
    t(document).on("click", '[data-action="post-pending"]', function (e) {
        e.preventDefault();
        var a = t(this), s = tinyMCE.get("post_content").getContent(), r = t("#post_title").val();
        if (!s) return createButterbar("文章内容不能为空。", !0);
        if (!r || r.length > 200) return createButterbar("文章内容为空或者标题过长。", !0);
        clearInterval(n);
        var l = t(".fa-editor-form").serialize() + "&action=add_pending&post_content=" + encodeURIComponent(s);
        t.ajax({
            url: PURE.ajax_url, type: "POST", dataType: "json", data: l, success: function (e) {
                if (1 == e.success) {
                    o = !0, t(".surface-container").addClass("u-hide");
                    i.append('<div class="overlay overlay--dark"><div class="overlay-dialog"><h3 class="overlay-title">作品提交成功</h3><div class="overlay-content u-textAlignLeft"><p>运营小妹将在24小时内审核稿件，请耐心等待。</p><p>审核状态请留意站内信、短信或邮件通知。</p><p>有如问题请咨询QQ：419297645</p></div><div class="overlay-actions buttonSet button--link u-paddingBottom30"><a href="/me/posts/" class="button button--primary button--small button--sq">我的文章</a><a href="/" class="button button--small button--dark button--sq">返回首页</a></div></div></div>')
                } else createButterbar(e.message, !0), a.removeClass("is-active")
            }
        })
    });
    var o = !1;
    t(document).on("click", '[data-action="post-draft"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            var s = tinyMCE.get("post_content").getContent(), i = t("#post_title").val();
            if (!s) return createButterbar("文章内容不能为空。", !0);
            if (!i || i.length > 200) return createButterbar("文章内容为空或者标题过长。", !0);
            var n = t(".fa-editor-form").serialize() + "&action=add_draft&post_content=" + encodeURIComponent(s);
            a.addClass("is-active"), a.html("保存中..."), t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: n,
                success: function (e) {
                    e.post_id && !t("#post_id").length && t(".fa-editor-form").append('<input type="hidden" name="post_id" id="post_id" value="' + e.post_id + '">'), t("#wpuf-preview").attr("href", e.url).show(), createButterbar("草稿保存成功"), a.removeClass("is-active"), a.html("保存草稿")
                }
            })
        }
    });
    var r = "";
    t(window).on("scroll", function () {
        t(".mce-toolbar-grp").length && !r && (r = t(".mce-toolbar-grp").offset().top);
        var e = t(this).scrollTop();
        r && e >= r ? t(".mce-toolbar-grp").addClass("is-sticky") : t(".mce-toolbar-grp").removeClass("is-sticky")
    })
}(jQuery), !function (t) {
    t.fn.slide = function (e) {
        return t.fn.slide.defaults = {
            type: "slide",
            effect: "fade",
            autoPlay: !1,
            delayTime: 500,
            interTime: 2500,
            triggerTime: 150,
            defaultIndex: 0,
            titCell: ".hd li",
            mainCell: ".bd",
            targetCell: null,
            trigger: "mouseover",
            scroll: 1,
            vis: 1,
            titOnClassName: "on",
            autoPage: !1,
            prevCell: ".prev",
            nextCell: ".next",
            pageStateCell: ".pageState",
            opp: !1,
            pnLoop: !0,
            easing: "swing",
            startFun: null,
            endFun: null,
            switchLoad: null,
            playStateCell: ".playState",
            mouseOverStop: !0,
            defaultPlay: !0,
            returnDefault: !1
        }, this.each(function () {
            var a = t.extend({}, t.fn.slide.defaults, e), s = t(this), i = a.effect, n = t(a.prevCell, s),
                o = t(a.nextCell, s), r = t(a.pageStateCell, s), l = t(a.playStateCell, s), c = t(a.titCell, s),
                d = c.size(), u = t(a.mainCell, s), p = u.children().size(), m = a.switchLoad, v = t(a.targetCell, s),
                f = parseInt(a.defaultIndex), h = parseInt(a.delayTime), g = parseInt(a.interTime);
            parseInt(a.triggerTime);
            var y, _ = parseInt(a.scroll), b = parseInt(a.vis), C = "false" != a.autoPlay && 0 != a.autoPlay,
                w = "false" != a.opp && 0 != a.opp, k = "false" != a.autoPage && 0 != a.autoPage,
                T = "false" != a.pnLoop && 0 != a.pnLoop, x = "false" != a.mouseOverStop && 0 != a.mouseOverStop,
                j = "false" != a.defaultPlay && 0 != a.defaultPlay,
                E = "false" != a.returnDefault && 0 != a.returnDefault, I = 0, P = 0, S = 0, O = 0, D = a.easing,
                U = null, R = null, M = null, A = a.titOnClassName, N = c.index(s.find("." + A)),
                L = f = -1 == N ? f : N, B = f, z = f, Q = p >= b ? 0 != p % _ ? p % _ : _ : 0,
                q = "leftMarquee" == i || "topMarquee" == i, W = function () {
                    t.isFunction(a.startFun) && a.startFun(f, d, s, t(a.titCell, s), u, v, n, o)
                }, G = function () {
                    t.isFunction(a.endFun) && a.endFun(f, d, s, t(a.titCell, s), u, v, n, o)
                }, $ = function () {
                    c.removeClass(A), j && c.eq(B).addClass(A)
                };
            if ("menu" == a.type) return j && c.removeClass(A).eq(f).addClass(A), c.hover(function () {
                y = t(this).find(a.targetCell);
                var e = c.index(t(this));
                R = setTimeout(function () {
                    switch (f = e, c.removeClass(A).eq(f).addClass(A), W(), i) {
                        case"fade":
                            y.stop(!0, !0).animate({opacity: "show"}, h, D, G);
                            break;
                        case"slideDown":
                            y.stop(!0, !0).animate({height: "show"}, h, D, G)
                    }
                }, a.triggerTime)
            }, function () {
                switch (clearTimeout(R), i) {
                    case"fade":
                        y.animate({opacity: "hide"}, h, D);
                        break;
                    case"slideDown":
                        y.animate({height: "hide"}, h, D)
                }
            }), void(E && s.hover(function () {
                clearTimeout(M)
            }, function () {
                M = setTimeout($, h)
            }));
            if (0 == d && (d = p), q && (d = 2), k) {
                if (p >= b) if ("leftLoop" == i || "topLoop" == i) d = 0 != p % _ ? 1 + (0 ^ p / _) : p / _; else {
                    var F = p - b;
                    0 >= (d = 1 + parseInt(0 != F % _ ? F / _ + 1 : F / _)) && (d = 1)
                } else d = 1;
                c.html("");
                var H = "";
                if (1 == a.autoPage || "true" == a.autoPage) for (var V = 0; d > V; V++) H += "<li>" + (V + 1) + "</li>"; else for (var V = 0; d > V; V++) H += a.autoPage.replace("$", V + 1);
                c.html(H);
                var c = c.children()
            }
            if (p >= b) {
                u.children().each(function () {
                    t(this).width() > S && (S = t(this).width(), P = t(this).outerWidth(!0)), t(this).height() > O && (O = t(this).height(), I = t(this).outerHeight(!0))
                });
                var Z = u.children(), X = function () {
                    for (var t = 0; b > t; t++) Z.eq(t).clone().addClass("clone").appendTo(u);
                    for (var t = 0; Q > t; t++) Z.eq(p - t - 1).clone().addClass("clone").prependTo(u)
                };
                switch (i) {
                    case"fold":
                        u.css({position: "relative", width: P, height: I}).children().css({
                            position: "absolute",
                            width: S,
                            left: 0,
                            top: 0,
                            display: "none"
                        });
                        break;
                    case"top":
                        u.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' + b * I + 'px"></div>').css({
                            top: -f * _ * I,
                            position: "relative",
                            padding: "0",
                            margin: "0"
                        }).children().css({height: O});
                        break;
                    case"left":
                        u.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' + b * P + 'px"></div>').css({
                            width: p * P,
                            left: -f * _ * P,
                            position: "relative",
                            overflow: "hidden",
                            padding: "0",
                            margin: "0"
                        }).children().css({float: "left", width: S});
                        break;
                    case"leftLoop":
                    case"leftMarquee":
                        X(), u.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' + b * P + 'px"></div>').css({
                            width: (p + b + Q) * P,
                            position: "relative",
                            overflow: "hidden",
                            padding: "0",
                            margin: "0",
                            left: -(Q + f * _) * P
                        }).children().css({float: "left", width: S});
                        break;
                    case"topLoop":
                    case"topMarquee":
                        X(), u.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' + b * I + 'px"></div>').css({
                            height: (p + b + Q) * I,
                            position: "relative",
                            padding: "0",
                            margin: "0",
                            top: -(Q + f * _) * I
                        }).children().css({height: O})
                }
            }
            var Y = function (t) {
                var e = t * _;
                return t == d ? e = p : -1 == t && 0 != p % _ && (e = -p % _), e
            }, K = function (e) {
                var a = function (a) {
                    for (var s = a; b + a > s; s++) e.eq(s).find("img[" + m + "]").each(function () {
                        var e = t(this);
                        if (e.attr("src", e.attr(m)).removeAttr(m), u.find(".clone")[0]) for (var a = u.children(), s = 0; s < a.size(); s++) a.eq(s).find("img[" + m + "]").each(function () {
                            t(this).attr(m) == e.attr("src") && t(this).attr("src", t(this).attr(m)).removeAttr(m)
                        })
                    })
                };
                switch (i) {
                    case"fade":
                    case"fold":
                    case"top":
                    case"left":
                    case"slideDown":
                        a(f * _);
                        break;
                    case"leftLoop":
                    case"topLoop":
                        a(Q + Y(z));
                        break;
                    case"leftMarquee":
                    case"topMarquee":
                        var s = "leftMarquee" == i ? u.css("left").replace("px", "") : u.css("top").replace("px", ""),
                            n = "leftMarquee" == i ? P : I, o = Q;
                        if (0 != s % n) {
                            var r = Math.abs(0 ^ s / n);
                            o = 1 == f ? Q + r : Q + r - 1
                        }
                        a(o)
                }
            }, J = function (t) {
                if (!j || L != f || t || q) {
                    if (q ? f >= 1 ? f = 1 : 0 >= f && (f = 0) : (z = f, f >= d ? f = 0 : 0 > f && (f = d - 1)), W(), null != m && K(u.children()), v[0] && (y = v.eq(f), null != m && K(v), "slideDown" == i ? (v.not(y).stop(!0, !0).slideUp(h), y.slideDown(h, D, function () {
                            u[0] || G()
                        })) : (v.not(y).stop(!0, !0).hide(), y.animate({opacity: "show"}, h, function () {
                            u[0] || G()
                        }))), p >= b) switch (i) {
                        case"fade":
                            u.children().stop(!0, !0).eq(f).animate({opacity: "show"}, h, D, function () {
                                G()
                            }).siblings().hide();
                            break;
                        case"fold":
                            u.children().stop(!0, !0).eq(f).animate({opacity: "show"}, h, D, function () {
                                G()
                            }).siblings().animate({opacity: "hide"}, h, D);
                            break;
                        case"top":
                            u.stop(!0, !1).animate({top: -f * _ * I}, h, D, function () {
                                G()
                            });
                            break;
                        case"left":
                            u.stop(!0, !1).animate({left: -f * _ * P}, h, D, function () {
                                G()
                            });
                            break;
                        case"leftLoop":
                            var e = z;
                            u.stop(!0, !0).animate({left: -(Y(z) + Q) * P}, h, D, function () {
                                -1 >= e ? u.css("left", -(Q + (d - 1) * _) * P) : e >= d && u.css("left", -Q * P), G()
                            });
                            break;
                        case"topLoop":
                            var e = z;
                            u.stop(!0, !0).animate({top: -(Y(z) + Q) * I}, h, D, function () {
                                -1 >= e ? u.css("top", -(Q + (d - 1) * _) * I) : e >= d && u.css("top", -Q * I), G()
                            });
                            break;
                        case"leftMarquee":
                            var a = u.css("left").replace("px", "");
                            0 == f ? u.animate({left: ++a}, 0, function () {
                                u.css("left").replace("px", "") >= 0 && u.css("left", -p * P)
                            }) : u.animate({left: --a}, 0, function () {
                                u.css("left").replace("px", "") <= -(p + Q) * P && u.css("left", -Q * P)
                            });
                            break;
                        case"topMarquee":
                            var s = u.css("top").replace("px", "");
                            0 == f ? u.animate({top: ++s}, 0, function () {
                                u.css("top").replace("px", "") >= 0 && u.css("top", -p * I)
                            }) : u.animate({top: --s}, 0, function () {
                                u.css("top").replace("px", "") <= -(p + Q) * I && u.css("top", -Q * I)
                            })
                    }
                    c.removeClass(A).eq(f).addClass(A), L = f, T || (o.removeClass("nextStop"), n.removeClass("prevStop"), 0 == f && n.addClass("prevStop"), f == d - 1 && o.addClass("nextStop")), r.html("<span>" + (f + 1) + "</span>/" + d)
                }
            };
            j && J(!0), E && s.hover(function () {
                clearTimeout(M)
            }, function () {
                M = setTimeout(function () {
                    f = B, j ? J() : "slideDown" == i ? y.slideUp(h, $) : y.animate({opacity: "hide"}, h, $), L = f
                }, 300)
            });
            var tt = function (t) {
                U = setInterval(function () {
                    w ? f-- : f++, J()
                }, t || g)
            }, et = function (t) {
                U = setInterval(J, t || g)
            }, at = function () {
                x || (clearInterval(U), tt())
            }, st = function () {
                (T || f != d - 1) && (f++, J(), q || at())
            }, it = function () {
                (T || 0 != f) && (f--, J(), q || at())
            }, nt = function () {
                clearInterval(U), q ? et() : tt(), l.removeClass("pauseState")
            }, ot = function () {
                clearInterval(U), l.addClass("pauseState")
            };
            if (C ? q ? (w ? f-- : f++, et(), x && u.hover(ot, nt)) : (tt(), x && s.hover(ot, nt)) : (q && (w ? f-- : f++), l.addClass("pauseState")), l.click(function () {
                    l.hasClass("pauseState") ? nt() : ot()
                }), "mouseover" == a.trigger ? c.hover(function () {
                    var t = c.index(this);
                    R = setTimeout(function () {
                        f = t, J(), at()
                    }, a.triggerTime)
                }, function () {
                    clearTimeout(R)
                }) : c.click(function () {
                    f = c.index(this), J(), at()
                }), q) {
                if (o.mousedown(st), n.mousedown(it), T) {
                    var rt, lt = function () {
                        rt = setTimeout(function () {
                            clearInterval(U), et(0 ^ g / 10)
                        }, 150)
                    }, ct = function () {
                        clearTimeout(rt), clearInterval(U), et()
                    };
                    o.mousedown(lt), o.mouseup(ct), n.mousedown(lt), n.mouseup(ct)
                }
                "mouseover" == a.trigger && (o.hover(st, function () {
                }), n.hover(it, function () {
                }))
            } else o.click(st), n.click(it)
        })
    }
}(jQuery), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (t, e, a, s, i) {
        return jQuery.easing[jQuery.easing.def](t, e, a, s, i)
    },
    easeInQuad: function (t, e, a, s, i) {
        return s * (e /= i) * e + a
    },
    easeOutQuad: function (t, e, a, s, i) {
        return -s * (e /= i) * (e - 2) + a
    },
    easeInOutQuad: function (t, e, a, s, i) {
        return (e /= i / 2) < 1 ? s / 2 * e * e + a : -s / 2 * (--e * (e - 2) - 1) + a
    },
    easeInCubic: function (t, e, a, s, i) {
        return s * (e /= i) * e * e + a
    },
    easeOutCubic: function (t, e, a, s, i) {
        return s * ((e = e / i - 1) * e * e + 1) + a
    },
    easeInOutCubic: function (t, e, a, s, i) {
        return (e /= i / 2) < 1 ? s / 2 * e * e * e + a : s / 2 * ((e -= 2) * e * e + 2) + a
    },
    easeInQuart: function (t, e, a, s, i) {
        return s * (e /= i) * e * e * e + a
    },
    easeOutQuart: function (t, e, a, s, i) {
        return -s * ((e = e / i - 1) * e * e * e - 1) + a
    },
    easeInOutQuart: function (t, e, a, s, i) {
        return (e /= i / 2) < 1 ? s / 2 * e * e * e * e + a : -s / 2 * ((e -= 2) * e * e * e - 2) + a
    },
    easeInQuint: function (t, e, a, s, i) {
        return s * (e /= i) * e * e * e * e + a
    },
    easeOutQuint: function (t, e, a, s, i) {
        return s * ((e = e / i - 1) * e * e * e * e + 1) + a
    },
    easeInOutQuint: function (t, e, a, s, i) {
        return (e /= i / 2) < 1 ? s / 2 * e * e * e * e * e + a : s / 2 * ((e -= 2) * e * e * e * e + 2) + a
    },
    easeInSine: function (t, e, a, s, i) {
        return -s * Math.cos(e / i * (Math.PI / 2)) + s + a
    },
    easeOutSine: function (t, e, a, s, i) {
        return s * Math.sin(e / i * (Math.PI / 2)) + a
    },
    easeInOutSine: function (t, e, a, s, i) {
        return -s / 2 * (Math.cos(Math.PI * e / i) - 1) + a
    },
    easeInExpo: function (t, e, a, s, i) {
        return 0 == e ? a : s * Math.pow(2, 10 * (e / i - 1)) + a
    },
    easeOutExpo: function (t, e, a, s, i) {
        return e == i ? a + s : s * (1 - Math.pow(2, -10 * e / i)) + a
    },
    easeInOutExpo: function (t, e, a, s, i) {
        return 0 == e ? a : e == i ? a + s : (e /= i / 2) < 1 ? s / 2 * Math.pow(2, 10 * (e - 1)) + a : s / 2 * (2 - Math.pow(2, -10 * --e)) + a
    },
    easeInCirc: function (t, e, a, s, i) {
        return -s * (Math.sqrt(1 - (e /= i) * e) - 1) + a
    },
    easeOutCirc: function (t, e, a, s, i) {
        return s * Math.sqrt(1 - (e = e / i - 1) * e) + a
    },
    easeInOutCirc: function (t, e, a, s, i) {
        return (e /= i / 2) < 1 ? -s / 2 * (Math.sqrt(1 - e * e) - 1) + a : s / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + a
    },
    easeInElastic: function (t, e, a, s, i) {
        var n = 1.70158, o = 0, r = s;
        if (0 == e) return a;
        if (1 == (e /= i)) return a + s;
        if (o || (o = .3 * i), r < Math.abs(s)) {
            r = s;
            var n = o / 4
        } else var n = o / (2 * Math.PI) * Math.asin(s / r);
        return -r * Math.pow(2, 10 * (e -= 1)) * Math.sin(2 * (e * i - n) * Math.PI / o) + a
    },
    easeOutElastic: function (t, e, a, s, i) {
        var n = 1.70158, o = 0, r = s;
        if (0 == e) return a;
        if (1 == (e /= i)) return a + s;
        if (o || (o = .3 * i), r < Math.abs(s)) {
            r = s;
            var n = o / 4
        } else var n = o / (2 * Math.PI) * Math.asin(s / r);
        return r * Math.pow(2, -10 * e) * Math.sin(2 * (e * i - n) * Math.PI / o) + s + a
    },
    easeInOutElastic: function (t, e, a, s, i) {
        var n = 1.70158, o = 0, r = s;
        if (0 == e) return a;
        if (2 == (e /= i / 2)) return a + s;
        if (o || (o = .3 * i * 1.5), r < Math.abs(s)) {
            r = s;
            var n = o / 4
        } else var n = o / (2 * Math.PI) * Math.asin(s / r);
        return 1 > e ? -.5 * r * Math.pow(2, 10 * (e -= 1)) * Math.sin(2 * (e * i - n) * Math.PI / o) + a : .5 * r * Math.pow(2, -10 * (e -= 1)) * Math.sin(2 * (e * i - n) * Math.PI / o) + s + a
    },
    easeInBack: function (t, e, a, s, i, n) {
        return void 0 == n && (n = 1.70158), s * (e /= i) * e * ((n + 1) * e - n) + a
    },
    easeOutBack: function (t, e, a, s, i, n) {
        return void 0 == n && (n = 1.70158), s * ((e = e / i - 1) * e * ((n + 1) * e + n) + 1) + a
    },
    easeInOutBack: function (t, e, a, s, i, n) {
        return void 0 == n && (n = 1.70158), (e /= i / 2) < 1 ? s / 2 * e * e * ((1 + (n *= 1.525)) * e - n) + a : s / 2 * ((e -= 2) * e * ((1 + (n *= 1.525)) * e + n) + 2) + a
    },
    easeInBounce: function (t, e, a, s, i) {
        return s - jQuery.easing.easeOutBounce(t, i - e, 0, s, i) + a
    },
    easeOutBounce: function (t, e, a, s, i) {
        return (e /= i) < 1 / 2.75 ? 7.5625 * s * e * e + a : 2 / 2.75 > e ? s * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + a : 2.5 / 2.75 > e ? s * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + a : s * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + a
    },
    easeInOutBounce: function (t, e, a, s, i) {
        return i / 2 > e ? .5 * jQuery.easing.easeInBounce(t, 2 * e, 0, s, i) + a : .5 * jQuery.easing.easeOutBounce(t, 2 * e - i, 0, s, i) + .5 * s + a
    }
}), function (t) {
    t.tablesort = function (e, a) {
        var s = this;
        this.$table = e, this.$thead = this.$table.find("thead"), this.settings = t.extend({}, t.tablesort.defaults, a), this.$sortCells = this.$thead.length > 0 ? this.$thead.find("th:not(.no-sort)") : this.$table.find("th:not(.no-sort)"), this.$sortCells.on("click.tablesort", function () {
            s.sort(t(this))
        }), this.index = null, this.$th = null, this.direction = null
    }, t.tablesort.prototype = {
        sort: function (e, a) {
            var s = new Date, i = this, n = this.$table, o = n.find("tbody").length > 0 ? n.find("tbody") : n,
                r = o.find("tr").has("td, th"), l = r.find(":nth-child(" + (e.index() + 1) + ")").filter("td, th"),
                c = e.data().sortBy, d = [], u = l.map(function (a, s) {
                    return c ? "function" == typeof c ? c(t(e), t(s), i) : c : null != t(this).data().sortValue ? t(this).data().sortValue : t(this).text()
                });
            0 !== u.length && (this.index !== e.index() ? (this.direction = "asc", this.index = e.index()) : this.direction = "asc" !== a && "desc" !== a ? "asc" === this.direction ? "desc" : "asc" : a, a = "asc" == this.direction ? 1 : -1, i.$table.trigger("tablesort:start", [i]), i.log("Sorting by " + this.index + " " + this.direction), i.$table.css("display"), setTimeout(function () {
                i.$sortCells.removeClass(i.settings.asc + " " + i.settings.desc);
                for (var n = 0, c = u.length; n < c; n++) d.push({index: n, cell: l[n], row: r[n], value: u[n]});
                d.sort(function (t, e) {
                    return i.settings.compare(t.value, e.value) * a
                }), t.each(d, function (t, e) {
                    o.append(e.row)
                }), e.addClass(i.settings[i.direction]), i.log("Sort finished in " + ((new Date).getTime() - s.getTime()) + "ms"), i.$table.trigger("tablesort:complete", [i]), i.$table.css("display")
            }, u.length > 2e3 ? 200 : 10))
        }, log: function (e) {
            (t.tablesort.DEBUG || this.settings.debug) && console && console.log && console.log("[tablesort] " + e)
        }, destroy: function () {
            return this.$sortCells.off("click.tablesort"), this.$table.data("tablesort", null), null
        }
    }, t.tablesort.DEBUG = !1, t.tablesort.defaults = {
        debug: t.tablesort.DEBUG,
        asc: "sorted ascending",
        desc: "sorted descending",
        compare: function (t, e) {
            return t > e ? 1 : t < e ? -1 : 0
        }
    }, t.fn.tablesort = function (e) {
        var a, s;
        return this.each(function () {
            a = t(this), s = a.data("tablesort"), s && s.destroy(), a.data("tablesort", new t.tablesort(a, e))
        })
    }
}(window.Zepto || window.jQuery), function (t) {
    function e(t) {
        var e, a = new RegExp("(^| )" + t + "=([^;]*)(;|$)");
        return (e = document.cookie.match(a)) ? unescape(e[2]) : null
    }

    function a() {
        return !!(window.ActiveXObject || "ActiveXObject" in window)
    }

    function s(t) {
        return null != t.match(/\.(jpeg|jpg|gif|png)$/)
    }

    function i() {
        t(".top-banner").slideUp(800)
    }

    function n(t) {
        var e = t.url, a = t.image, s = '<div class="overlay overlay--dark">';
        s += '<div class="overlay-ad overlay-dialog--animate"><a class="close-btn-2" data-action="overlay-close" href="javascript:;"></a><a href="' + e + '" target="_blank"><img src="' + a + '"></</div>', s += "</div>", o.append(s)
    }

    var o = t("body");
    t('[data-action="uplike"]').length > 0 && t('[data-action="uplike"]').each(function (a, s) {
        var i = t(this);
        e("post_action_" + i.data("id")) && i.addClass("is-active")
    }), t(document).on("click", '[data-action="top-banner-close"]', function (t) {
        t.preventDefault(), i()
    }), window.hideTopBanner = i, e("overlayShow") || a() || t.ajax({
        url: PURE.restapi + "v1/advertisment",
        type: "GET",
        dataType: "json",
        data: {isHome: PURE.is_home},
        success: function (e) {
            if (200 == e.status) {
                var a = e.d;
                if ("1" == a.target) {
                    var s = '<div class="top-banner"><a class="overlayAdlink" data-id="' + a.id + '" href="' + a.link + '" target="_blank"><img src="' + a.image + '"></a><button class="overlayclose-btn button--close" data-action="top-banner-close">×</button></div>';
                    t(".surface-content").before(s), t(".top-banner").slideDown(800), o.addClass("not-fixed")
                } else {
                    var s = '<div class="overlay overlay--dark">';
                    s += '<div class="overlay-ad overlay-dialog--animate"><a class="close-btn-2" data-action="overlay-close" href="javascript:;"></a><a class="overlayAdlink" data-id="' + a.id + '" href="' + a.link + '" target="_blank"><img src="' + a.image + '"></a></div>', s += "</div>", o.append(s)
                }
            }
        }
    }), t(document).on("click", '[data-action="overlay-preview"]', function (e) {
        var a = t(".overlayImage--input").val();
        if (!s(a)) return createButterbar("图片地址参数错误", !0), void t(".overlayImage--input").focus();
        n({url: "", image: a})
    }), t(".overlayImage--input").bind("input propertychange", function () {
        var e = t(this), a = e.val();
        s(a) && t(".js-image").attr("src", a)
    }), t(document).on("change", '[action="show-activeAd"]', function (e) {
        t(this).is(":checked") ? t(".overlay-list-item:not(.is-active)").addClass("u-hide") : t(".overlay-list-item:not(.is-active)").removeClass("u-hide")
    }), t(document).on("click", ".overlayAdlink", function (e) {
        var a = t(this), s = a.data("id");
        t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            dataType: "json",
            data: {action: "overlayClick", id: s},
            success: function (t) {
            }
        })
    }), t(document).on("change", ".showEverywhere--check", function (e) {
        t(this).is(":checked") ? (t(".form-row-cities,.form-row-provices").addClass("u-hide"), t(".form-row-cities,.form-row-provices").find(".demo--radio").removeAttr("checked")) : t(".form-row-cities,.form-row-provices").removeClass("u-hide")
    }), t(document).on("click", '[data-action="save-collection"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = t(".form").serialize() + "&action=add_overlay";
            t.ajax({
                url: PURE.ajax_url, type: "POST", data: s, success: function (t) {
                    createButterbar("创建成功"), a.removeClass("is-active")
                }
            })
        }
    })
}(jQuery), function (t) {
    function e(e) {
        t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            dataType: "json",
            data: {action: "check_trade", trade_id: e},
            success: function (e) {
                200 == e.CODE ? e.RESULT.ispay && (t(".wpd-overlay-body").html(i), clearInterval(s)) : 500 == e.status && (clearInterval(s), alert(e.message))
            }
        })
    }

    function a() {
        clearInterval(s), t(".overlay").remove()
    }

    var s;
    t(document).on("click", ".button--pay", function (e) {
        var a = t(this), s = a.data("post-id"), i = a.data("avatar"), n = a.data("author"),
            o = t(".support-title").html(),
            r = '<div class="overlay overlay--dark"><div class="wpd-dialog"><button class="wpd-btn-close" data-action="overlay-close">×</button><div class="wpd-overlay-body"><header class="wpd-header"><img class="wpd-avatar" src="' + i + '"><h3 class="wpd-title">' + o + '</h3></header><div class="wpd-payway u-textAlignLeft"><h5 class="wpd-payway-title">选择支付金额</h5><div><label class="demo--label"><input class="demo--radio" type="radio" name="paycount" value="1" checked=true><span class="demo--radioText">1元</span></label><label class="demo--label"><input class="demo--radio" type="radio" name="paycount" value="2"><span class="demo--radioText">2元</span></label><label class="demo--label"><input class="demo--radio" type="radio" name="paycount" value="5"><span class="demo--radioText">5元</span></label></div></div><div class="wpd-payway u-textAlignLeft"><h5 class="wpd-payway-title">选择支付方式</h5><label class="demo--label"><input class="demo--radio" type="radio" name="payway" value="wechat" checked=true><span class="demo--radioInput"></span><img class="day wechat" src="//image.woshipm.com/wp-files/2017/08/BXSWI33kxkno7ro13E4h.png"></label><label class="demo--label"><input class="demo--radio" type="radio" name="payway" value="alipay"><span class="demo--radioInput"></span><img class="day alipay" src="//image.woshipm.com/wp-files/2017/08/jIjdFOOUZUr57boyGkL1.png"></label></div><div class="wpd-inputs u-textAlignLeft"><div class="wpd-input-item message"><textarea id="reward_message" name="message" class="wpd-input-textarea" placeholder="给Ta留言"></textarea></div></div><input name="postid" type="hidden" value="' + s + '"><input name="authorid" type="hidden" value="' + n + '"><div class="overlay-actions buttonSet"><div class="buttonSet buttonSet--vertical"><button class="wpd-btn-confirm" data-action="pay"><span class="button-label js-buttonLabel">立即支付</span></button><div class="wpd-overlay-notice">注：打赏的收益归作者，非平台</div></div></div></div></div></div>';
        t("body").append(r)
    });
    var i = '<svg width="80" height="80" viewBox="0 0 64 64"><path d="M925.030941 337.564156c-22.537296-53.283554-54.797024-101.132328-95.882767-142.218072-41.084721-41.085744-88.934518-73.345472-142.218072-95.881744-55.17667-23.337521-113.7763-35.171034-174.170808-35.171034S393.764132 76.126818 338.588485 99.464339c-53.283554 22.536272-101.132328 54.796-142.218072 95.881744s-73.345472 88.934518-95.881744 142.218072c-23.337521 55.175647-35.171034 113.775276-35.171034 174.170808 0 60.395532 11.83249 118.995161 35.171034 174.170808 22.536272 53.283554 54.796 101.132328 95.881744 142.218072 41.085744 41.084721 88.934518 73.344448 142.218072 95.881744 55.175647 23.337521 113.775276 35.170011 174.170808 35.170011s118.994138-11.83249 174.170808-35.170011c53.28253-22.537296 101.132328-54.797024 142.218072-95.881744 41.085744-41.085744 73.345472-88.934518 95.882767-142.218072 23.337521-55.175647 35.170011-113.775276 35.170011-174.170808C960.200952 451.339432 948.367439 392.739802 925.030941 337.564156zM512.759293 918.243351c-224.149083 0-406.508387-182.359304-406.508387-406.508387s182.359304-406.508387 406.508387-406.508387c224.150106 0 406.509411 182.359304 406.509411 406.508387S736.909399 918.243351 512.759293 918.243351zM621.354594 281.552467l-72.883961 134.291542c-19.436678 36.393885-31.323403 60.584843-35.666314 72.573899l-1.24127 0c-12.822027-29.153994-49.002041-98.107435-108.550275-206.865441l-68.541049 0 127.46916 218.96092L357.423459 500.513388l0 48.381917 122.507148 0 0 66.680678L357.423459 615.575983l0 49.003064 122.507148 0 0 97.074919 60.787458 0 0-97.074919 118.166283 0 0-49.003064L540.717042 615.575983l0-66.680678 118.166283 0 0-48.381917-101.416807 0 128.708384-218.96092L621.354594 281.552467z" fill="#272636" /></svg><p>报告土豪，您已打赏成功。</p><p class="wpd-overlay-notice">注：打赏数据显示有延迟</p>';
    t(document).on("click", '[data-action="overlay-close"]', function (t) {
        a()
    }), window.check_trade = e, t(document).on("click", '[data-action="pay"]', function (e) {
        var n = t('input[name="paycount"]:checked').val(), o = t("#reward_message").val(),
            r = t('input[name="payway"]:checked').val(), l = t('input[name="authorid"]').val(),
            c = t('input[name="postid"]').val();
        if (o.length > 60) return alert("留言内容必须小于30字。");
        if (!t.isNumeric(n) || parseFloat(n) < 1) return alert("金额不能小于1");
        if (!t(this).hasClass("is-active")) if (t(this).addClass("is-active").html("loading"), "alipay" == r) {
            var d = "http://api.woshipm.com/reward/aliPcPay.html?authorId=" + l + "&articleId=" + c + "&totalFee=" + n + "&payType=1&platType=1&source=1&message=" + o + "&COMMON_ACCESS_TOKEN=" + PURE.token + "&COMMON_ACCESS_TOKEN_SECRET=" + PURE.secret;
            window.open(d), t(".wpd-overlay-body").html(i), clearInterval(s)
        } else t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            dataType: "json",
            data: {action: "donation_qrcode", count: n, author: l, postid: c, type: r, message: o},
            success: function (e) {
                if (200 != e.CODE) alert("输入内容有误，重新输入。"), a(); else {
                    var i = "<h4>微信扫码支付</h4><p>打赏金额：<span>" + n + ' 元</span></p><img width=300 height=300 src="http://qr.liantu.com/api.php?text=' + e.RESULT.code_url + '"></div>';
                    t(".wpd-overlay-body").html(i), window.doooo_trade_id = e.RESULT.orderNo, s = setInterval("check_trade(doooo_trade_id)", 1e3)
                }
            }
        })
    })
}(jQuery);
var _typeof = "function" == typeof Symbol && "symbol" === _typeof2(Symbol.iterator) ? function (t) {
    return void 0 === t ? "undefined" : _typeof2(t)
} : function (t) {
    return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : void 0 === t ? "undefined" : _typeof2(t)
}, _createClass = function () {
    function t(t, e) {
        for (var a = 0; a < e.length; a++) {
            var s = e[a];
            s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s)
        }
    }

    return function (e, a, s) {
        return a && t(e.prototype, a), s && t(e, s), e
    }
}(), ScrollSpy = function (t) {
    var e = "scrollspy", a = "4.0.0-alpha.6", s = "bs.scrollspy", i = "." + s, n = ".data-api", o = t.fn[e],
        r = {offset: 10, method: "auto", target: ""},
        l = {offset: "number", method: "string", target: "(string|element)"},
        c = {ACTIVATE: "activate" + i, SCROLL: "scroll" + i, LOAD_DATA_API: "load" + i + n},
        d = {DROPDOWN_ITEM: "dropdown-item", DROPDOWN_MENU: "dropdown-menu", ACTIVE: "active"}, u = {
            DATA_SPY: '[data-spy="scroll"]',
            ACTIVE: ".active",
            NAV_LIST_GROUP: ".nav, .list-group",
            NAV_LINKS: ".nav-link",
            LIST_ITEMS: ".list-group-item",
            DROPDOWN: ".dropdown",
            DROPDOWN_ITEMS: ".dropdown-item",
            DROPDOWN_TOGGLE: ".dropdown-toggle"
        }, p = {OFFSET: "offset", POSITION: "position"}, m = function () {
            function n(e, a) {
                var s = this;
                _classCallCheck(this, n), this._element = e, this._scrollElement = "BODY" === e.tagName ? window : e, this._config = this._getConfig(a), this._selector = this._config.target + " " + u.NAV_LINKS + "," + this._config.target + " " + u.LIST_ITEMS + "," + this._config.target + " " + u.DROPDOWN_ITEMS, this._offsets = [], this._targets = [], this._activeTarget = null, this._scrollHeight = 0, t(this._scrollElement).on(c.SCROLL, function (t) {
                    return s._process(t)
                }), this.refresh(), this._process()
            }

            return n.prototype.refresh = function () {
                var e = this, a = this._scrollElement !== this._scrollElement.window ? p.POSITION : p.OFFSET,
                    s = "auto" === this._config.method ? a : this._config.method,
                    i = s === p.POSITION ? this._getScrollTop() : 0;
                this._offsets = [], this._targets = [], this._scrollHeight = this._getScrollHeight(), t.makeArray(t(this._selector)).map(function (e) {
                    var a = void 0, n = Util.getSelectorFromElement(e);
                    if (n && (a = t(n)[0]), a) {
                        var o = a.getBoundingClientRect();
                        if (o.width || o.height) return [t(a)[s]().top + i, n]
                    }
                    return null
                }).filter(function (t) {
                    return t
                }).sort(function (t, e) {
                    return t[0] - e[0]
                }).forEach(function (t) {
                    e._offsets.push(t[0]), e._targets.push(t[1])
                })
            }, n.prototype.dispose = function () {
                t.removeData(this._element, s), t(this._scrollElement).off(i), this._element = null, this._scrollElement = null, this._config = null, this._selector = null, this._offsets = null, this._targets = null, this._activeTarget = null, this._scrollHeight = null
            }, n.prototype._getConfig = function (a) {
                if (a = t.extend({}, r, a), "string" != typeof a.target) {
                    var s = t(a.target).attr("id");
                    s || (s = Util.getUID(e), t(a.target).attr("id", s)), a.target = "#" + s
                }
                return Util.typeCheckConfig(e, a, l), a
            }, n.prototype._getScrollTop = function () {
                return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop
            }, n.prototype._getScrollHeight = function () {
                return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)
            }, n.prototype._getOffsetHeight = function () {
                return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height
            }, n.prototype._process = function () {
                var t = this._getScrollTop() + this._config.offset, e = this._getScrollHeight(),
                    a = this._config.offset + e - this._getOffsetHeight();
                if (this._scrollHeight !== e && this.refresh(), t >= a) {
                    var s = this._targets[this._targets.length - 1];
                    return void(this._activeTarget !== s && this._activate(s))
                }
                if (this._activeTarget && t < this._offsets[0] && this._offsets[0] > 0) return this._activeTarget = null, void this._clear();
                for (var i = this._offsets.length; i--;) {
                    this._activeTarget !== this._targets[i] && t >= this._offsets[i] && (void 0 === this._offsets[i + 1] || t < this._offsets[i + 1]) && this._activate(this._targets[i])
                }
            }, n.prototype._activate = function (e) {
                this._activeTarget = e, this._clear();
                var a = this._selector.split(",");
                a = a.map(function (t) {
                    return t + '[data-target="' + e + '"],' + t + '[href="' + e + '"]'
                });
                var s = t(a.join(","));
                s.hasClass(d.DROPDOWN_ITEM) ? (s.closest(u.DROPDOWN).find(u.DROPDOWN_TOGGLE).addClass(d.ACTIVE), s.addClass(d.ACTIVE)) : (s.addClass(d.ACTIVE), s.parents(u.NAV_LIST_GROUP).prev(u.NAV_LINKS + ", " + u.LIST_ITEMS).addClass(d.ACTIVE)), t(this._scrollElement).trigger(c.ACTIVATE, {relatedTarget: e})
            }, n.prototype._clear = function () {
                t(this._selector).filter(u.ACTIVE).removeClass(d.ACTIVE)
            }, n._jQueryInterface = function (e) {
                return this.each(function () {
                    var a = t(this).data(s), i = "object" === (void 0 === e ? "undefined" : _typeof(e)) && e;
                    if (a || (a = new n(this, i), t(this).data(s, a)), "string" == typeof e) {
                        if (void 0 === a[e]) throw new Error('No method named "' + e + '"');
                        a[e]()
                    }
                })
            }, _createClass(n, null, [{
                key: "VERSION", get: function () {
                    return a
                }
            }, {
                key: "Default", get: function () {
                    return r
                }
            }]), n
        }();
    return t(window).on(c.LOAD_DATA_API, function () {
        for (var e = t.makeArray(t(u.DATA_SPY)), a = e.length; a--;) {
            var s = t(e[a]);
            m._jQueryInterface.call(s, s.data())
        }
    }), t.fn[e] = m._jQueryInterface, t.fn[e].Constructor = m, t.fn[e].noConflict = function () {
        return t.fn[e] = o, m._jQueryInterface
    }, m
}(jQuery);
!function (t) {
    function e() {
        var e = parseInt(c.val());
        d.val(), e ? t("#tab-slider tbody > tr:gt(0)").show() : t("#tab-slider tbody > tr:gt(0)").hide()
    }

    var a = t(".rimowa-top-nav .nav > li:not(.disabled)"), s = t(".div-tab"), i = t(".pure-setting-switch"),
        n = t(".pure-setting-upload"), o = t(".pure-setting-radio"), r = t("#progress"), l = t(".sidepos"),
        c = t("#pure-setting-slider-active"), d = t("#pure-setting-slider-source"), u = t("#pure-form"),
        p = t('[data-action="theme-save"]'), m = (t(window), !1);
    if (l.click(function (e) {
            e.preventDefault();
            var a = t(this), s = a.attr("rel"), i = a.parent(), n = i.children("input");
            return a.hasClass("current") || (a.parent().find(".sidepos").removeClass("current"), a.addClass("current")), n.val(s), !1
        }), a.click(function (e) {
            console.log("sb");
            var i = t(this), n = a.index(i);
            if (!i.hasClass("active")) {
                var o = a.index(i);
                s.addClass("hidden").eq(o).removeClass("hidden"), a.removeClass("active"), i.addClass("active"), window.localStorage && (localStorage.currentTab = n)
            }
        }), window.localStorage) {
        var v = localStorage.currentTab;
        v && a.eq(v).click()
    }
    i.click(function (e) {
        var a = t(this), s = t("#" + a.attr("data-id"));
        a.hasClass("active") ? (a.removeClass("active"), s.val(0)) : (a.addClass("active"), s.val(1)), s.change()
    }), n.click(function (e) {
        var a = t(this), s = t("#" + a.attr("data-id")), i = t("#" + a.attr("data-id") + "-preview");
        "undefined" != typeof tb_show && (tb_show("", global.adminurl + "media-upload.php?type=image&amp;TB_iframe=true"), window.send_to_editor = function (e) {
            var a = t("img", e).attr("src");
            i.html('<img src="' + a + '"/>'), s.val(a), tb_remove()
        });
        var n = wp.media.frames.file_frame = wp.media({multiple: !1});
        n.on("select", function () {
            var t = n.state().get("selection").first().toJSON(), e = t.url;
            i.html('<img src="' + e + '"/>'), s.val(e)
        }), n.open()
    }), o.click(function (e) {
        var a = t(this);
        if (!a.hasClass("checked")) {
            a.parent().children(".pure-setting-radio").removeClass("checked"), a.addClass("checked");
            var s = t("#" + a.attr("data-id")), i = a.attr("data-value");
            s.val(i).change()
        }
    }), p.click(function (e) {
        e.preventDefault(), t.ajax({
            url: PURE.ajax_url,
            data: u.serialize() + "&action=pure_setting",
            type: "POST",
            beforeSend: function () {
                m = !0, r.show()
            },
            success: function () {
                m = !1, r.addClass("success").children(".spinner-text").text("成功保存主题设置!"), setTimeout(function () {
                    r.hide().removeClass("success")
                }, 3e3)
            },
            error: function () {
                m = !1, r.addClass("error").children(".spinner-text").text("主题设置保存失败, 请稍候重试!"), setTimeout(function () {
                    r.hide().removeClass("error")
                }, 3e3)
            }
        })
    }), c.on("change", function () {
        e()
    }), e()
}(jQuery), function (t) {
    t(document).on("submit", ".slider_opppp", function (e) {
        e.preventDefault(), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            data: t(this).serialize() + "&action=pure_slider",
            success: function (t) {
                alert("保存成功")
            }
        })
    }), t(document).on("submit", ".home-small-slider-form", function (e) {
        e.preventDefault(), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            data: t(this).serialize() + "&action=fa_slider_config",
            success: function (t) {
                alert("保存成功")
            }
        })
    });
    var e = 10;
    t(document).on("click", '[data-action="addBookItem"]', function (a) {
        a.preventDefault(), t(".books-ul").append('<li class="topas-list-item"><label for="tie_home_cats[' + e + '][name]"><span>图书标题</span><input class="topas-input-item" name="tie_home_cats[' + e + '][name]" value="" type="text" /></label><label for="tie_home_cats[' + e + '][link]"><span>图书链接</span><input class="topas-input-item" name="tie_home_cats[' + e + '][link]" value="" type="text" /></label><label for="tie_home_cats[' + e + '][image]"><span>图书封面</span><input class="topas-input-item" name="tie_home_cats[' + e + '][image]" value="" type="text" /></label><label for="tie_home_cats[' + e + '][description]"><span>图书描述</span><input class="topas-input-item" name="tie_home_cats[' + e + '][description]" value="" type="text" /></label></li>'), e++
    }), t(document).on("click", '[data-action="addLargeSlider"]', function (a) {
        a.preventDefault(), t(".home_large_sliders").append('<li class="topas-list-item"><label for="fa_sliders[home_large][' + e + '][name]"><span>图片标题</span><input class="topas-input-item" name="fa_sliders[home_large][' + e + '][name]" value="" type="text" /></label><label for="fa_sliders[home_large][' + e + '][link]"><span>图片链接</span><input class="topas-input-item" name="fa_sliders[home_large][' + e + '][link]" value="" type="text" /></label><label for="fa_sliders[home_large][' + e + '][image]"><span>图片地址</span><input class="topas-input-item" name="fa_sliders[home_large][' + e + '][image]" value="" type="text" /></label></li>'), e++
    }), t(document).on("click", '[data-action="addEventSlider"]', function (a) {
        a.preventDefault(), t(".event_large_sliders").append('<li class="topas-list-item"><label for="fa_sliders[event_large][' + e + '][link]"><span>图片链接</span><input class="topas-input-item" name="fa_sliders[event_large][' + e + '][link]" value="" type="text" /></label><label for="fa_sliders[event_large][' + e + '][image]"><span>图片地址</span><input class="topas-input-item" name="fa_sliders[event_large][' + e + '][image]" value="" type="text" /></label></li>'), e++
    }), t(document).on("click", ".slider-delete", function (e) {
        e.preventDefault(), t(this).parent().remove()
    }), t(document).on("click", ".book-delete", function (e) {
        e.preventDefault(), t(this).parent().remove()
    })
}(jQuery), function (t) {
    var e = {
        insertImage: function () {
            var e = "avatar-upload", a = "user-avatar-container";
            if (!t("#" + e).length) return console.log(wpuf_frontend_upload.flash_swf_url);
            var s = new plupload.Uploader({
                runtimes: "html5,html4",
                browse_button: e,
                container: a,
                multipart: !0,
                multipart_params: {action: "wpuf_file_upload"},
                multiple_queues: !1,
                multi_selection: !1,
                urlstream_upload: !0,
                file_data_name: "wpuf_file",
                max_file_size: "2mb",
                url: wpuf_frontend_upload.plupload.url,
                flash_swf_url: wpuf_frontend_upload.plupload.flash_swf_url,
                filters: [{title: "Allowed Files", extensions: "jpg,jpeg,gif,png,bmp"}]
            });
            s.bind("Init", function (t, e) {
                console.log("Current runtime environment: " + e.runtime)
            }), s.bind("FilesAdded", function (e, a) {
                t("body").addClass("is-loadingApp"), e.refresh(), e.start()
            }), s.bind("QueueChanged", function (t) {
                s.start()
            }), s.bind("UploadProgress", function (e, a) {
                var s = t("#" + a.id);
                t(".bar", s).css({width: a.percent + "%"}), t(".percent", s).html(a.percent + "%")
            }), s.bind("Error", function (e, a) {
                var s = a.message;
                "-200" == a.code && (s = "网络错误。"), "-600" == a.code && (s = "文件过大。"), createButterbar(s, !0), t("body").removeClass("is-loadingApp")
            }), s.bind("FileUploaded", function (e, a, s) {
                if (t("body").removeClass("is-loadingApp"), "error" !== s.response) {
                    var i = '<img src="' + s.response + '!avatar" height=128 width=128 /><input id="user-avatar" type="hidden" value="' + s.response + '">';
                    t(".user-avatar-preview").html(i)
                } else alert("Something went wrong")
            }), s.init()
        }
    };
    t(function () {
        e.insertImage()
    }), t(document).on("click", ".button--saveAvatar", function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            var s = t("#user-avatar").val();
            if (!s) return createButterbar("头像无更新。", !0);
            a.addClass("is-active"), t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: {action: "update_user_avatar", avatar: s},
                success: function (e) {
                    200 == e.CODE && (createButterbar("保存成功"), t(".author-page-info .avatar").attr("src", s + "!avatar"), a.removeClass("is-active"))
                }
            })
        }
    })
}(jQuery), function (t) {
    function e() {
        var t = document.createElement("bootstrap"), e = {
            WebkitTransition: "webkitTransitionEnd",
            MozTransition: "transitionend",
            OTransition: "oTransitionEnd otransitionend",
            transition: "transitionend"
        };
        for (var a in e) if (void 0 !== t.style[a]) return {end: e[a]};
        return !1
    }

    t.fn.emulateTransitionEnd = function (e) {
        var a = !1, s = this;
        t(this).one("bsTransitionEnd", function () {
            a = !0
        });
        var i = function () {
            a || t(s).trigger(t.support.transition.end)
        };
        return setTimeout(i, e), this
    }, t(function () {
        t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = {
            bindType: t.support.transition.end,
            delegateType: t.support.transition.end,
            handle: function (e) {
                if (t(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
            }
        })
    })
}(jQuery), function (t) {
    function e() {
        this._activeZoom = this._initialScrollPosition = this._initialTouchPosition = this._touchMoveListener = null, this._$document = t(document), this._$window = t(window), this._$body = t(document.body), this._boundClick = t.proxy(this._clickHandler, this)
    }

    function a(e) {
        this._fullHeight = this._fullWidth = this._overlay = this._targetImageWrap = null, this._targetImage = e, this._$body = t(document.body)
    }

    e.prototype.listen = function () {
        this._$body.on("click", '[data-action="zoom"]', t.proxy(this._zoom, this))
    }, e.prototype._zoom = function (e) {
        var s = e.target;
        if (s && "IMG" == s.tagName && !this._$body.hasClass("zoom-overlay-open")) return e.metaKey || e.ctrlKey ? window.open(e.target.getAttribute("data-original") || e.target.src, "_blank") : void(s.width >= t(window).width() - a.OFFSET || (this._activeZoomClose(!0), this._activeZoom = new a(s), this._activeZoom.zoomImage(), this._$window.on("scroll.zoom", t.proxy(this._scrollHandler, this)), this._$document.on("keyup.zoom", t.proxy(this._keyHandler, this)), this._$document.on("touchstart.zoom", t.proxy(this._touchStart, this)), document.addEventListener ? document.addEventListener("click", this._boundClick, !0) : document.attachEvent("onclick", this._boundClick, !0), "bubbles" in e ? e.bubbles && e.stopPropagation() : e.cancelBubble = !0))
    }, e.prototype._activeZoomClose = function (t) {
        this._activeZoom && (t ? this._activeZoom.dispose() : this._activeZoom.close(), this._$window.off(".zoom"), this._$document.off(".zoom"), document.removeEventListener("click", this._boundClick, !0), this._activeZoom = null)
    }, e.prototype._scrollHandler = function (e) {
        null === this._initialScrollPosition && (this._initialScrollPosition = t(window).scrollTop());
        var a = this._initialScrollPosition - t(window).scrollTop();
        Math.abs(a) >= 40 && this._activeZoomClose()
    }, e.prototype._keyHandler = function (t) {
        27 == t.keyCode && this._activeZoomClose()
    }, e.prototype._clickHandler = function (t) {
        t.preventDefault ? t.preventDefault() : event.returnValue = !1, "bubbles" in t ? t.bubbles && t.stopPropagation() : t.cancelBubble = !0, this._activeZoomClose()
    }, e.prototype._touchStart = function (e) {
        this._initialTouchPosition = e.touches[0].pageY, t(e.target).on("touchmove.zoom", t.proxy(this._touchMove, this))
    }, e.prototype._touchMove = function (e) {
        Math.abs(e.touches[0].pageY - this._initialTouchPosition) > 10 && (this._activeZoomClose(), t(e.target).off("touchmove.zoom"))
    }, a.OFFSET = 80, a._MAX_WIDTH = 2560, a._MAX_HEIGHT = 4096, a.prototype.zoomImage = function () {
        var e = document.createElement("img");
        e.onload = t.proxy(function () {
            this._fullHeight = Number(e.height), this._fullWidth = Number(e.width), this._zoomOriginal()
        }, this), e.src = this._targetImage.src
    }, a.prototype._zoomOriginal = function () {
        this._targetImageWrap = document.createElement("div"), this._targetImageWrap.className = "zoom-img-wrap", this._targetImage.parentNode.insertBefore(this._targetImageWrap, this._targetImage), this._targetImageWrap.appendChild(this._targetImage), t(this._targetImage).addClass("zoom-img").attr("data-action", "zoom-out"), this._overlay = document.createElement("div"), this._overlay.className = "zoom-overlay", document.body.appendChild(this._overlay), this._calculateZoom(), this._triggerAnimation()
    }, a.prototype._calculateZoom = function () {
        this._targetImage.offsetWidth;
        var e = this._fullWidth, s = this._fullHeight, i = (t(window).scrollTop(), e / this._targetImage.width),
            n = t(window).height() - a.OFFSET, o = t(window).width() - a.OFFSET, r = e / s, l = o / n;
        this._imgScaleFactor = e < o && s < n ? i : r < l ? n / s * i : o / e * i
    }, a.prototype._triggerAnimation = function () {
        this._targetImage.offsetWidth;
        var e = t(this._targetImage).offset(), a = t(window).scrollTop(), s = a + t(window).height() / 2,
            i = t(window).width() / 2, n = e.top + this._targetImage.height / 2,
            o = e.left + this._targetImage.width / 2;
        this._translateY = s - n, this._translateX = i - o;
        var r = "scale(" + this._imgScaleFactor + ")",
            l = "translate(" + this._translateX + "px, " + this._translateY + "px)";
        t.support.transition && (l += " translateZ(0)"), t(this._targetImage).css({
            "-webkit-transform": r,
            "-ms-transform": r,
            transform: r
        }), t(this._targetImageWrap).css({
            "-webkit-transform": l,
            "-ms-transform": l,
            transform: l
        }), this._$body.addClass("zoom-overlay-open")
    }, a.prototype.close = function () {
        if (this._$body.removeClass("zoom-overlay-open").addClass("zoom-overlay-transitioning"), t(this._targetImage).css({
                "-webkit-transform": "",
                "-ms-transform": "",
                transform: ""
            }), t(this._targetImageWrap).css({
                "-webkit-transform": "",
                "-ms-transform": "",
                transform: ""
            }), !t.support.transition) return this.dispose();
        t(this._targetImage).one(t.support.transition.end, t.proxy(this.dispose, this)).emulateTransitionEnd(300)
    }, a.prototype.dispose = function () {
        this._targetImageWrap && this._targetImageWrap.parentNode && (t(this._targetImage).removeClass("zoom-img").attr("data-action", "zoom"), this._targetImageWrap.parentNode.replaceChild(this._targetImage, this._targetImageWrap), this._overlay.parentNode.removeChild(this._overlay), this._$body.removeClass("zoom-overlay-transitioning"))
    }, t(function () {
        (new e).listen()
    })
}(jQuery), jQuery(".category-banner").slide({
    mainCell: ".category-slider",
    titCell: ".supernice li",
    effect: "left",
    triggerTime: 1e3,
    autoPlay: !0
}), jQuery(".main-slider").slide({
    mainCell: ".bd ul",
    titCell: ".supernice li",
    effect: "left",
    triggerTime: 1e3,
    autoPlay: !0
}), jQuery(".focusBox").slide({
    mainCell: ".pic",
    effect: "fold",
    autoPlay: !0,
    delayTime: 600,
    trigger: "click"
}), jQuery(".widget-slider").slide({
    mainCell: ".images",
    titCell: ".supernice li",
    effect: "left",
    triggerTime: 1e3,
    autoPlay: !0
}), function (t) {
    t(document).on("click", '[data-action="adminsb"]', function (e) {
        var a = t(this), s = a.data("id");
        console.log(s), a.hasClass("is-processing") || (a.addClass("is-processing"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            data: {action: "fa_hide_post", id: s},
            success: function (t) {
                a.hasClass("is-active") ? a.removeClass("is-active") : a.addClass("is-active"), a.removeClass("is-processing")
            }
        }))
    }), t(document).on("click", '[data-action="adminniubi"]', function (e) {
        var a = t(this), s = a.data("id");
        console.log(s), a.hasClass("is-processing") || (a.addClass("is-processing"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            data: {action: "fa_niubi_post", id: s},
            success: function (t) {
                a.hasClass("is-active") ? a.removeClass("is-active") : a.addClass("is-active"), a.removeClass("is-processing")
            }
        }))
    })
}(jQuery), function (t) {
    function e() {
        p.addClass("is-loadingApp")
    }

    function a() {
        p.removeClass("is-loadingApp")
    }

    function s() {
        var t = '<div class="overlay overlay--dark">';
        t += '<div class="overlay-dialog"><button class="overlayclose-btn button--close" data-action="overlay-close">×</button><h3 class="overlay-title title--phone">为方便接收稿件通知，请先绑定手机号</h3><div class="overlay-content"><form id="user-phone-add" class="phone-form"><p><input  placeholder="手机号" id="user-phone-number" name="user_phone" value="" type="text"></p><p class="user-info-message"></p><p><input placeholder="验证码" class="input--creditNum" id="creditnum" name="creditnum" value="" type="text"><button class="button--sendMessage">发送验证码</button></p><p><input value="立即绑定" class="phone-submit" type="submit"></p></form></div></div>', t += "</div>", p.append(t)
    }

    function i(t) {
        if (0 == g) return t.attr("disabled", !1), t.html("发送验证码"), void(g = 60);
        t.attr("disabled", !0), t.html("重新发送(" + g + ")"), g--, setTimeout(function () {
            i(t)
        }, 1e3)
    }

    function n() {
        var t = '<div class="overlay overlay--dark"><button class="overlayclose-btn button--close" data-action="overlay-close">×</button><iframe id="top_login_frame" src="http://passport.woshipm.com/user/2popLogin.html?_protocol=http&FS=PM&ISPOP=1&REDIRECT=' + window.location.href + '" width=380 height=506 scrolling="no" class="top_fc_box"></iframe></div>';
        p.append(t)
    }

    function o(t) {
        return '<div class="event-item u-backgroundColorWhite ' + t.event_info.type + '"><div class="img"><a href="' + t.permalink + '" target="_blank"><img src="' + t.image + '!/both/570x280"></a></div><div class="content"><h2 class="title"><a href="' + t.permalink + '" target="_blank">' + t.title + '</a></h2><div class="meta"><div class="date"><span class="fa fa-clock-o"></span>' + t.event_info.date + '</div><div class="address"><span class="fa fa-map-marker"></span>' + t.event_info.location + "</div>" + t.event_info.button + "</div></div></div>"
    }

    function r(t) {
        var e = t.author,
            a = '<span class="avatar-inline"><a target="_blank" href="' + e.link + '">' + e.avatar + '</a></span><span class="author"><a target="_blank" href="' + e.link + '">' + e.name + "</a></span>";
        return '<div class="postlist-item"><div class="post-img"><a href="' + t.permalink + '" target="_blank"><img src="' + t.image + '!/both/202x145" height="140" width="215"></a><div class="post-cat ' + t.catslug + '">' + t.category + '</div></div><div class="content"><h2 class="post-title"><a target="_blank" href="' + t.permalink + '">' + t.title + '</a></h2><p class="des">' + t.snipper + '</p><div class="stream-list-meta">' + a + '<span class="dot"></span><time>' + t.date + '</time><div class="u-floatRight post-meta-items"><span class="post-meta-item"><span class="fa fa-eye"></span>' + t.view + '</span><span class="post-meta-item"><span class="fa fa-star"></span>' + t.bookmark + '</span><span class="post-meta-item"><span class="fa fa-thumbs-up"></span>' + t.like + "</span></div></div></div></div></div>"
    }

    function l(t) {
        var e = t.match(/[^\x00-\xff]/gi);
        return t.length + (null == e ? 0 : e.length)
    }

    function c(e) {
        var a = 0;
        t.each(e, function (t, e) {
            var s = parseInt(e);
            a = s > a ? s : a
        }), a = a < 5 ? 5 : a, console.log(a);
        for (var s = 1; a / s >= 10;) s *= 10;
        for (var i = a, n = 6, o = 4, r = 0, l = 0, c = !0; c;) {
            for (var d = n; d >= o; d--) {
                var u = i / d;
                if (i % d == 0 && (u == 1 * s || u == .2 * s || u == .5 * s || u == 2 * s || u == 5 * s)) {
                    c = !1, r = u, l = d;
                    break
                }
            }
            i++
        }
        i--, l--;
        var p = r;
        return l = Math.ceil(a / p), console.log(p), l * p
    }

    function d(t) {
        for (var e = "", a = t / 5, s = 0; s < 6; s++) {
            e += '<span class="bargraph-y-axis-item" style="bottom:' + (44 * s - 8) + 'px;">' + a * s + "</span>"
        }
        return e
    }

    function u(e) {
        var a = e, s = "", i = c(a);
        console.log(i);
        var n = d(i);
        t(".bargraph-y-axis").html(n), t.each(a, function (t, e) {
            var a = Math.floor(220 * e / i);
            s += '<div class="bargraph-bar" data-action="stat-posts" data-action-value="' + t + '" title="' + e + '" style="width: 31px; left: ' + (50 + 36 * t) + "px; top: " + (220 - a) + "px; height: " + a + 'px;"></div>'
        }), t(".bargraph-bars").html(s)
    }

    var p = t("body"), m = PURE.restapi + "v1/", v = !1, f = function () {
        var e = t(".butterBar");
        e.length && e.remove()
    };
    window.clearButterbar = f;
    var h = function (t, e) {
        f();
        var a = e ? " butterBar--error" : "";
        p.append('<div class="butterBar butterBar--center' + a + '"><p class="butterBar-message">' + t + "</p></div>"), setTimeout("clearButterbar()", 3e3)
    };
    window.createButterbar = h, t(document).on("click", '[data-action="showPhoneOAuth"]', function (e) {
        return e.preventDefault(), t(".overlay").remove(), s()
    }), t(document).on("submit", "#user-phone-add", function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            var s = t("#user-phone-number").val();
            if (!/^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(s)) return t(".user-info-message").html("请输入正确的手机号。");
            var i = t("#creditnum").val();
            a.addClass("is-active"), t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: {action: "checkCreditNum", phone: s, verifyCode: i},
                success: function (e) {
                    console.log(e), 200 == e.CODE ? (t(".user-info-message").html(e.RESULT.cName), t(".overlay").remove(), h("绑定成功")) : (t(".user-info-message").html(e.RESULT.cName), a.removeClass("is-active"))
                }
            })
        }
    });
    var g = 60;
    t(document).on("click", ".button--sendMessage", function (e) {
        e.preventDefault();
        var a = t(this), s = t("#user-phone-number").val();
        if (!/^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(s)) return t(".user-info-message").html("请输入正确的手机号。");
        a.html("发送中..."), a.addClass("is-active"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            dataType: "json",
            data: {action: "sendMessage", phoneNum: s},
            success: function (e) {
                200 == e.CODE ? (i(a), t(".user-info-message").html(e.RESULT.cName)) : (t(".user-info-message").html(e.RESULT.cName), a.html("发送验证码"), a.removeClass("is-active"))
            }
        })
    }), t(document).on("click", ".button--cancelsubauthor", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        a.hasClass("is-active") || (a.addClass("is-active"), p.addClass("is-loadingApp"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            dataType: "json",
            data: {id: s, action: "cancelsubauthor"},
            success: function (e) {
                200 == e.CODE && (t(".user-" + s).remove(), p.removeClass("is-loadingApp"), h("取消订阅成功"))
            }
        }))
    });
    var y = t(".bigfa-ajax-wrapper").html(), _ = "", b = "", C = "", w = "", k = t(".bigfa-ajax-wrapper").html(),
        T = "", x = "", j = "", E = "";
    t(document).on("click", ".load-user-posts", function (e) {
        e.preventDefault();
        var a = t(this);
        if (a.hasClass("is-active")) return !1;
        t(".authorTab li").removeClass("is-active"), a.addClass("is-active"), t(".bigfa-ajax-wrapper").html(y)
    }), t(document).on("click", ".show-search", function (e) {
        t("body").hasClass("body-search") ? t("body").removeClass("body-search") : t("body").addClass("body-search")
    }), t(document).on("click", ".load-user-bookmark", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        return !a.hasClass("is-active") && (t(".authorTab li").removeClass("is-active"), a.addClass("is-active"), w ? t(".bigfa-ajax-wrapper").html(w) : (p.addClass("is-loadingApp"), void t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            data: {id: s, action: "get_user_bookmark"},
            success: function (e) {
                w = e, t(".bigfa-ajax-wrapper").html(w), p.removeClass("is-loadingApp")
            }
        })))
    }), t(document).on("click", ".load-user-CommentController.class", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        return !a.hasClass("is-active") && (t(".authorTab li").removeClass("is-active"), a.addClass("is-active"), C ? t(".bigfa-ajax-wrapper").html(C) : (p.addClass("is-loadingApp"), void t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            data: {id: s, action: "get_user_comment"},
            success: function (e) {
                C = '<ul class="user-comments">' + e + "</ul>", t(".bigfa-ajax-wrapper").html(C), p.removeClass("is-loadingApp")
            }
        })))
    }), t(document).on("click", ".load-user-question", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        return !a.hasClass("is-active") && (t(".authorTab li").removeClass("is-active"), a.addClass("is-active"), _ ? t(".bigfa-ajax-wrapper").html(_) : (p.addClass("is-loadingApp"), void t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            data: {id: s, action: "get_user_question"},
            success: function (e) {
                _ = e, t(".bigfa-ajax-wrapper").html(e), p.removeClass("is-loadingApp")
            }
        })))
    }), t(document).on("click", ".load-user-answer", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        return !a.hasClass("is-active") && (t(".authorTab li").removeClass("is-active"), a.addClass("is-active"), b ? t(".bigfa-ajax-wrapper").html(b) : (p.addClass("is-loadingApp"), void t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            data: {id: s, action: "get_user_answer"},
            success: function (e) {
                b = e, t(".bigfa-ajax-wrapper").html(e), p.removeClass("is-loadingApp")
            }
        })))
    }), t(document).on("click", ".button--follow,.button--user", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id"), i = a.data("action");
        if ("showLoginForm" == i) return n();
        p.addClass("is-loadingApp"), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            dataType: "json",
            data: {id: s, action: i},
            success: function (t) {
                "cancelsubauthor" == i ? (a.removeClass("is-active"), a.data("action", "subauthor"), h("取消订阅成功")) : (a.addClass("is-active"), a.data("action", "cancelsubauthor"), h("订阅成功")), p.removeClass("is-loadingApp")
            }
        })
    }), t(document).on("click", '[data-action="add-to-bookmarks"]', function (s) {
        s.preventDefault();
        var i = t(this), n = i.data("id"), o = i.find(".count"), r = parseInt(o.html());
        e(), t.ajax({
            url: m + "post/" + n + "/bookmarks",
            type: "PUT",
            headers: {"X-WP-Nonce": PURE.nonce},
            dataType: "json",
            success: function (t) {
                200 == t.status ? (o.html(r + 1), i.attr("data-action", "remove-from-bookmarks"), i.addClass("is-active"), h("收藏成功")) : h(t.data, !0), a()
            }
        })
    }), t(document).on("click", '[data-action="remove-from-bookmarks"]', function (s) {
        s.preventDefault();
        var i = t(this), n = i.data("id"), o = i.find(".count"), r = parseInt(o.html());
        e(), t.ajax({
            url: m + "post/" + n + "/bookmarks",
            type: "DELETE",
            headers: {"X-WP-Nonce": PURE.nonce},
            dataType: "json",
            success: function (t) {
                200 == t.status ? (o.html(r - 1), i.attr("data-action", "add-to-bookmarks"), h("取消收藏成功"), i.addClass("is-active")) : h(t.data, !0), a()
            }
        })
    }), t(document).on("click", '[data-action="uplike"]', function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        if (a.hasClass("is-active")) return h("您已经赞过了", !0);
        a.addClass("is-active"), t.ajax({
            url: m + "post/" + s + "/like",
            type: "POST",
            headers: {"X-WP-Nonce": PURE.nonce},
            dataType: "json",
            success: function (t) {
                a.find(".count").html(t.likes)
            }
        })
    }), t(".widget-book-item").hover(function () {
        var e = t(this);
        e.hasClass("is-active") || (t(".widget-book-item").removeClass("is-active"), e.addClass("is-active"))
    }, function () {
    });
    var I = '<div class="postlist-item postlist-item--placeholder"><div class="post-img"><div class="linePlaceholder linePlaceholder--image"></div></div><div class="content"><h2 class="post-title"><span class="linePlaceholder linePlaceholder--thicker linePlaceholder--truncated"></span></h2><p class="des"><span class="linePlaceholder linePlaceholder--thick"></span><span class="linePlaceholder linePlaceholder--thick linePlaceholder--truncated"></span></p><div class="stream-list-meta"><span class="avatar-inline"><span class="linePlaceholder linePlaceholder--avatar"></span></span><span class="author"><span class="linePlaceholder linePlaceholder--word"></span></span><span class="dot"></span><time><span class="linePlaceholder linePlaceholder--smaller"></span></time></div></div></div>';
    t(document).on("click", ".widget-hot-posts .btn", function (e) {
        e.preventDefault(), t(this).addClass("loading")
    }), t(document).on("click", '[data-action="loadLatestPosts"]', function (e) {
        e.preventDefault();
        var a = t(this);
        a.hasClass("is-active") || (t(".homeTab span").removeClass("is-active"), E && E.abort(), a.addClass("is-active"), t(".bigfa-ajax-wrapper").html(k))
    }), t(document).on("click", '[data-action="loadPopularQuestions"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            t(".homeTab span").removeClass("is-active"), E && E.abort();
            var s = t(".bigfa-ajax-wrapper");
            if (a.addClass("loading"), x) return s.html(x), a.removeClass("loading"), void a.addClass("is-active");
            t.ajax({
                url: PURE.restapi + "v1/popularQuestions", type: "GET", dataType: "json", success: function (e) {
                    var i = "";
                    t.each(e, function (e, a) {
                        var s = "";
                        a.LUInfos && t.each(a.LUInfos, function (t, e) {
                            s += '<a class="qes-queser-link" href="' + e.userUrl + '" target="_blank" title="' + e.LUName + '"><img class="user-qes-avatar" src="' + e.UAvatar + '"></a>'
                        }), i += '<div class="user-qes-item"><h2><a href="' + a.questionUrl + '" target="_blank">' + a.title + '</a></h2><div class="user-qes-meta">' + s + " 已有" + a.commentCount + '人参与了讨论<time><span class="iconfont icon-time"></span></time><div class="meta-right u-floatRight"><span class="fa fa-eye"></span>阅读' + a.clickCount + '<span class="fa fa-list"></span>回答' + a.commentCount + "</div></div></div>"
                    }), t(".postlist-item--placeholder").remove(), x = i, s.html(i), a.removeClass("loading"), a.addClass("is-active")
                }
            })
        }
    }), t(document).on("click", '[data-action="loadMySubPosts"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            t(".homeTab span").removeClass("is-active"), E && E.abort();
            var s = t(".bigfa-ajax-wrapper");
            if (a.addClass("loading"), j) return s.html(j), a.removeClass("loading"), void a.addClass("is-active");
            t.ajax({
                url: PURE.restapi + "v1/subscriptions/posts", type: "GET", dataType: "json", success: function (e) {
                    var i = e.payload;
                    if (i) {
                        var n = "";
                        t(".postlist-item--placeholder").remove(), t.each(i, function (t, e) {
                            n += r(e)
                        }), j = n, s.html(n)
                    } else {
                        s.html("暂无内容")
                    }
                    a.removeClass("loading"), a.addClass("is-active")
                }
            })
        }
    }), t(document).on("click", '[data-action="loadPopularposts"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            E && E.abort(), t(".homeTab span").removeClass("is-active");
            var s = t(".bigfa-ajax-wrapper");
            if (T) return s.html(T), a.removeClass("loading"), void a.addClass("is-active");
            "loadPopularposts" == a.data("action") && (a.addClass("loading"), t.ajax({
                url: PURE.restapi + "v1/browser/popular",
                type: "GET",
                dataType: "json",
                success: function (e) {
                    var i = e.payload, n = "";
                    t(".postlist-item--placeholder").remove(), t.each(i, function (t, e) {
                        n += r(e)
                    }), T = n, s.html(n), a.removeClass("loading"), a.addClass("is-active")
                }
            }))
        }
    }), t(document).on("click", '[data-action="laodUsers"]', function (e) {
        e.preventDefault();
        var a = t(this);
        a.addClass("u-hide");
        var s = t(".userList");
        s.append(I);
        var i = a.data("paged");
        t.ajax({
            url: PURE.restapi + "v1/user-suggestions",
            type: "GET",
            headers: {"X-WP-Nonce": PURE.nonce},
            dataType: "json",
            data: a.data(),
            success: function (e) {
                if (t(".postlist-item--placeholder").remove(), "false" == e.success) return a.remove();
                s.append(e.payload), a.data("paged", i + 1)
            }
        })
    }), t(document).on("click", '[data-action="loadEventItem"]', function (e) {
        e.preventDefault();
        var a = t(this);
        a.addClass("u-hide");
        var s = t(".js-postlist");
        s.append(I);
        var i = a.data("paged");
        t.ajax({
            url: PURE.restapi + "v1/stream-list",
            type: "GET",
            dataType: "json",
            data: a.data(),
            success: function (e) {
                if (t(".postlist-item--placeholder").remove(), "false" == e.success) return a.remove();
                var n = e.payload, r = "";
                t.each(n, function (t, e) {
                    r += o(e)
                }), s.append(r), a.data("paged", i + 1)
            }
        })
    });
    var P = !0;
    t(window).on("scroll", function () {
        if (t(".loadmore-home").length) {
            var e = t(".loadmore-home"), a = e.offset().top, s = t('[data-action="laodpost"]');
            if (t(this).scrollTop() + t(window).height() > a && 1 == P && s.data("paged") < 4) {
                P = !1, s.addClass("u-hide");
                var i = t(".js-postlist");
                i.append(I);
                var n = s.data("paged");
                t.ajax({
                    url: PURE.restapi + "v1/stream-list",
                    type: "GET",
                    dataType: "json",
                    data: s.data(),
                    success: function (e) {
                        var a = e.payload, o = "";
                        t(".postlist-item--placeholder").remove(), t.each(a, function (t, e) {
                            o += r(e)
                        }), i.append(o), s.data("paged", n + 1), P = !0
                    }
                })
            }
        }
    }), t(document).on("click", '[data-action="laodpost"]', function (e) {
        e.preventDefault();
        var a = t(this);
        a.addClass("u-hide");
        var s = t(".js-postlist");
        s.append(I);
        var i = a.data("paged");
        t.ajax({
            url: PURE.restapi + "v1/stream-list",
            type: "GET",
            dataType: "json",
            data: a.data(),
            success: function (e) {
                var n = e.payload, o = "";
                t(".postlist-item--placeholder").remove(), t.each(n, function (t, e) {
                    o += r(e)
                }), s.append(o), a.data("paged", i + 1)
            }
        })
    }), t(document).on("submit", "#user-info-update", function (e) {
        e.preventDefault();
        var a = t(this);
        if (l(a.find("textarea").val()) > 40) return h("个人资料过长", !0);
        if (l(a.find('input[name="nickname"]').val()) > 10) return h("昵称过长", !0);
        if (l(a.find('input[name="user_company"]').val()) > 15) return h("公司名过长", !0);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = a.serialize() + "&action=update_user_info";
            t.ajax({
                url: PURE.ajax_url, type: "POST", dataType: "json", data: s, success: function (t) {
                    (t.code = 200) ? h("资料更新成功") : h(t.message, !0), a.removeClass("is-active")
                }
            })
        }
    }), t(document).on("submit", "#update-user-password", function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = a.serialize() + "&action=update_user_password", i = t(".old-pass").val(), n = t(".new-pass").val(),
                o = t(".re-pass").val();
            return i && n && o ? n != o ? h("密码不一致，请重新确认") : i == n ? h("新旧密码不能一样") : void t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: s,
                success: function (t) {
                    (t.code = 500) ? h(t.message, !0) : h("密码修改成功。"), a.removeClass("is-active")
                }
            }) : h("密码不能为空", !0)
        }
    }), t(document).on("click", '[data-action="load-user-posts"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active"), p.addClass("is-loadingApp");
            var s = t(this).data("paged"), i = t(this).data("type");
            t.ajax({
                url: PURE.ajax_url,
                type: "GET",
                data: {action: "load_user_posts", paged: s, type: i},
                success: function (e) {
                    e ? (a.data("paged", s + 1), t(".user-bookmark").append(e)) : (a.remove(), h("已全部加载")), p.removeClass("is-loadingApp"), a.removeClass("is-active")
                }
            })
        }
    }), t(document).on("click", '[data-action="load-user-comments"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = t(this).data("paged");
            t.ajax({
                url: PURE.ajax_url,
                type: "GET",
                data: {action: "get_user_comments", paged: s},
                success: function (e) {
                    e ? (a.data("paged", s + 1), t(".user-comments").append(e)) : (a.remove(), h("没有更多了。", !0)), a.removeClass("is-active")
                }
            })
        }
    }), t(document).on("click", '[data-action="delete_comment"]', function (e) {
        e.preventDefault();
        var a = t(this), s = parseInt(t(".user-cn").html());
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var i = a.data("id");
            t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: {id: i, action: "user_delete_comment"},
                success: function (e) {
                    e.status ? (t("#CommentController.class-" + i).remove(), t(".user-cn").html(s - 1), h("评论已删除。")) : h("评论删除失败。", !0), a.removeClass("is-active")
                }
            })
        }
    }), t(document).on("click", ".eventTab-item", function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            t(".eventTab-item").removeClass("is-active"), a.addClass("is-active");
            var s = a.data("type");
            t(".js-postlist").attr("data-type", s)
        }
    }), t(document).on("click", '[data-action="load-bookmarks"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = t(this).data("paged");
            t.ajax({
                url: PURE.ajax_url,
                type: "GET",
                dataType: "json",
                data: {paged: s, action: "get_bookmark"},
                success: function (e) {
                    var i = e.posts, n = "";
                    if (console.log(i), 0 == i.length) return a.remove();
                    t.each(i, function (t, e) {
                        n += '<li class="bookmark-post-' + e.id + '"><a href="' + e.permalink + '">' + e.title + '</a><div class="u-floatRight meta"><time><span class="fa fa-clock-o"></span>' + e.date + '</time><span class="action"><span class="suusns u-cursorPointer" title="取消收藏" data-id="' + e.id + '"><span class="fa fa-trash"></span></span></span></div></li>'
                    }), t(".user-bookmark").append(n), a.removeClass("is-active"), a.data("paged", s + 1)
                }
            })
        }
    }), t(document).on("click", '[data-action="add-nav-item"]', function (e) {
        e.preventDefault(), t(".list").append('<li class="list-item list-item--compact"><div class="navItemEditor u-inlineBlock inputGroup"><input class="textInput textInput--narrow u-padding0 textInput--underlined list-itemInput list-itemInput--inline u-fontSize16 u-marginTop3 u-marginRight15 " placeholder="广告内容" name="ad[]" value="" type="text"></div><button class="button button--chromeless button--delete u-baseColor--buttonNormal button--withIcon button--withSvgIcon js-removeNavItem is-touched" data-action="remove-nav-item"><span class="svgIcon svgIcon--trashcan svgIcon--25px"><svg class="svgIcon-use" width="25" height="25" viewBox="0 0 25 25"><g fill-rule="evenodd"><path d="M10.5 5h4c.3 0 .5-.2.5-.5s-.2-.5-.5-.5h-4c-.3 0-.5.2-.5.5s.2.5.5.5zm4 12.8c.3 0 .5-.3.5-.5v-5.5c0-.3-.2-.5-.5-.5s-.5.2-.5.5v5.5c0 .3.2.5.5.5z"></path><path d="M19.2 7.5c0-.8-.6-1.5-1.4-1.5H7.2c-.8 0-1.4.7-1.4 1.5 0 .732.505 1.374 1.204 1.48 0 .006-.004.012-.004.02v11c0 .6.4 1 1 1h9c.6 0 1-.4 1-1V9c0-.012-.005-.02-.006-.032.67-.145 1.206-.768 1.206-1.468zM17 20H8V9h9v11zm.8-12H7.2c-.2 0-.4-.2-.4-.5S7 7 7.2 7h10.6c.3 0 .5.2.5.5s-.3.5-.5.5z"></path><path d="M12.5 17.8c.3 0 .5-.3.5-.5v-5.5c0-.3-.2-.5-.5-.5s-.5.2-.5.5v5.5c0 .3.2.5.5.5zm-2 0c.3 0 .5-.3.5-.5v-5.5c0-.3-.2-.5-.5-.5s-.5.2-.5.5v5.5c0 .3.2.5.5.5z"></path></g></svg></span></button></li>')
    }), t(document).on("click", '[data-action="remove-nav-item"]', function (e) {
        e.preventDefault(), t(this).parent().remove()
    }), t(document).on("click", '[data-action="save-ad"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var s = t(".form").serialize() + "&action=add_ad";
            t.ajax({
                url: PURE.ajax_url, type: "POST", data: s, success: function (t) {
                    h("创建成功"), a.removeClass("is-active")
                }
            })
        }
    });
    var S = function (t) {
        return t = t ? new Date(t) : new Date, console.log(t), new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0).getTime()
    };
    t(document).on("click", '[data-action="stat-posts"]', function (e) {
        var a = t(this), s = a.data("action-value"), i = S() / 1e3 - 24 * (27 - s) * 3600;
        e.preventDefault(), t.ajax({
            url: m + "stats/posts/date/" + i, type: "GET", success: function (e) {
                if ("true" == e.success) {
                    var a = e.payload, s = "";
                    t.each(a, function (t, e) {
                        s += '<tr class="sortableTable-row js-statsTableRow"><td class="sortableTable-rowTitle"><h2 class="sortableTable-title">' + e.title + "</h2></td><td>" + e.view + "</td><td>" + e.read + "</td><td>" + Math.ceil(e.read / e.view * 100) + "</td><td>" + e.like + "</td><td>" + e.bookmark + "</td></tr>"
                    }), t(".user-list-all").html(s), t("table").tablesort().data("tablesort")
                }
            }
        })
    }), t(".bargraph").length > 0 && t.ajax({
        url: m + "stats/view/" + (S() / 1e3 - 2332800) + "/" + S() / 1e3,
        type: "GET",
        dataType: "json",
        success: function (t) {
            "true" == t.success && u(t.payload)
        }
    }), t(".stats-post-list").length > 0 && t.ajax({
        url: m + "stats/posts/view/" + S() / 1e3,
        type: "GET",
        dataType: "json",
        success: function (e) {
            if ("true" == e.success) {
                var a = e.payload, s = "";
                t.each(a, function (t, e) {
                    s += '<div><a href="' + e.link + '">' + e.title + " | " + e.value + "</a></div>"
                }), t(".stats-post-list").html(s)
            }
        }
    });
    var O = "";
    t(document).on("click", '[data-action="switch-graph"]', function (e) {
        e.preventDefault();
        var a = t(this);
        if (!a.hasClass("is-active")) {
            t('[data-action="switch-graph"]').removeClass("is-active"), a.addClass("is-active");
            var s = a.data("action-value");
            O && O.abort(), O = t.ajax({
                url: m + "stats/" + s + "/" + (S() / 1e3 - 2332800) + "/" + S() / 1e3,
                type: "GET",
                dataType: "json",
                success: function (t) {
                    "true" == t.success && u(t.payload)
                }
            }), t.ajax({
                url: m + "stats/posts/" + s + "/" + S() / 1e3,
                type: "GET",
                dataType: "json",
                success: function (e) {
                    if ("true" == e.success) {
                        var a = e.payload, s = "";
                        t.each(a, function (t, e) {
                            s += '<div><a href="' + e.link + '">' + e.title + " | " + e.value + "</a></div>"
                        }), t(".stats-post-list").html(s)
                    }
                }
            })
        }
    }), PURE.is_singular && t.ajax({
        url: PURE.restapi + "v1/post/" + PURE.id + "/view",
        type: "POST",
        headers: {"X-WP-Nonce": PURE.nonce},
        dataType: "json",
        success: function (t) {
        }
    }), t(document).on("click", ".term-save", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id");
        if (a.hasClass("is-active")) return !1;
        var i = a.prev().val();
        a.addClass("is-active"), p.addClass("is-loadingApp"), t.ajax({
            url: PURE.ajax_url,
            type: "GET",
            data: {id: s, action: "set_term_img", value: i},
            success: function (t) {
                h("成功"), p.removeClass("is-loadingApp")
            }
        })
    });
    var D = 10;
    t(document).on("click", ".add_qidianla_class", function (e) {
        e.preventDefault();
        var a = "qidianla_classes";
        t(".qidianla-classes-ul").append('<li class="qidianla-classes-item"><label for="' + a + "[" + D + '][name]"><span>课程标题</span><input class="admin-textInput"  id="' + a + "[" + D + '][name]" name="' + a + "[" + D + '][name]" value="" type="text" /></label><label for="' + a + "[" + D + '][link]"><span>课程链接</span><input class="admin-textInput" name="' + a + "[" + D + '][link]" value="" type="text" /></label><label for="' + a + "[" + D + '][image]"><span>课程图片</span><input class="admin-textInput" name="' + a + "[" + D + '][image]" value="" type="text" /></label></li>'), D++
    }), t(document).on("click", '[data-action="qidianla_classes-delete"]', function (e) {
        e.preventDefault(), t(this).parent().parent().remove()
    }), t(document).on("submit", ".qidianla-classes-form", function (e) {
        e.preventDefault(), t.ajax({
            url: PURE.ajax_url,
            type: "POST",
            data: t(this).serialize() + "&action=qidianla_classes",
            success: function (t) {
                alert("保存成功")
            }
        })
    });
    var U = "";
    t(document).on("click", ".wenda-nav .uc-tab-item", function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("type");
        a.hasClass("current") || (t(".uc-tab-item").removeClass("current"), a.addClass("current"), "system" == s ? (t(".pm-notice-content").removeClass("u-hide"), t(".wen-notice-content").addClass("u-hide")) : (U || t.ajax({
            url: PURE.restapi + "v1/messages/wen",
            type: "GET",
            success: function (e) {
                "true" == e.success && (U = e.payload, t(".wen-notice-content").html(e.payload))
            }
        }), t(".pm-notice-content").addClass("u-hide"), t(".wen-notice-content").removeClass("u-hide")))
    }), t(document).on("click", '[data-action="toggleTermVote"]', function (e) {
        e.preventDefault();
        var a = t(this), s = a.data("id"), i = a.data("action-value");
        if (a.parent().hasClass("is-active")) return h("请勿重复点击。", !0);
        a.parent().addClass("is-active"), a.addClass("is-active"), p.addClass("is-loadingApp"), t.ajax({
            url: PURE.restapi + "v1/topic/" + s + "/" + i,
            type: "POST",
            dataType: "json",
            success: function (t) {
                a.find("span").html(t.payload.value), h("like" == i ? "老哥，稳啊。" : "骂的好，要改进。"), p.removeClass("is-loadingApp")
            }
        })
    }), PURE.is_user_logged_in && t.ajax({
        url: m + "activity-status",
        type: "GET",
        headers: {"X-WP-Nonce": PURE.nonce},
        dataType: "json",
        success: function (e) {
            var a = e.data, s = e.wen;
            if (a > 0 || s > 0) {
                var i = parseInt(a) + parseInt(s);
                t(".message--link").append('<span class="message-count">' + i + "</span>").addClass("has-message")
            }
            s > 0 && t(".wen-nav").addClass("has-unread"), a > 0 && t(".system-nav").addClass("has-unread")
        }
    }), t(".top-activity").length > 0 && t.ajax({
        url: m + "event-suggestions",
        type: "GET",
        headers: {"X-WP-Nonce": PURE.nonce},
        dataType: "json",
        success: function (e) {
            e && t(".top-activity").html(e)
        }
    }), t(".stream-list-topic").length > 0 && t.ajax({
        url: m + "topic-suggestions",
        type: "GET",
        headers: {"X-WP-Nonce": PURE.nonce},
        dataType: "json",
        success: function (e) {
            if (e) {
                var a = "";
                t.each(e, function (t, e) {
                    a += '<a target="_blank" href="' + e.link + '" class="stream-img-pad" style="background-image: url(' + e.image + ');"><div class="mark">专题</div><div class="info"><div class="title">' + e.name + '</div><div class="desc">' + e.description + '</div><div class="stream-topic-meta">' + e.views + '人已学习<span class="dot"></span>' + e.count + "篇文章</div></div></a>"
                }), t(".stream-list-topic").html(a), k = t(".bigfa-ajax-wrapper").html()
            }
        }
    }), t(document).on("click", ".suusns", function (e) {
        e.preventDefault();
        var a = t(this), s = parseInt(t(".user-bookmark-count").html());
        if (!a.hasClass("is-active")) {
            a.addClass("is-active");
            var i = a.data("id");
            t.ajax({
                url: PURE.ajax_url,
                type: "POST",
                dataType: "json",
                data: {id: i, action: "bookmark"},
                success: function (e) {
                    t(".bookmark-post-" + i).remove(), h("取消收藏成功"), t(".user-bookmark-count").html(s - 1)
                }
            })
        }
    }), t(document).on("click", '[data-action="popLogin"]', function (t) {
        return t.preventDefault(), n()
    }), t(".fixed-sidebar-id").length > 0 && t(window).on("scroll", function () {
        var e = t(".js-sidebar"), a = e.offset().top;
        t(this).scrollTop() > a + e.height() && t(".site-footer").offset().top > t(this).scrollTop() + t(window).height() ? t(".fixed-sidebar-id").addClass("is-fixed") : t(".fixed-sidebar-id").removeClass("is-fixed")
    }), PURE.is_singular && t(window).on("scroll", function () {
        if (t(".support-author").length) {
            var e = t(".support-author").offset().top;
            t(this).scrollTop() + t(window).height() > e && 0 == v && (v = !0, t.ajax({
                url: m + "post/" + PURE.id + "/read",
                type: "POST",
                headers: {"X-WP-Nonce": PURE.nonce},
                dataType: "json",
                success: function (t) {
                }
            }))
        }
    }), t(window).on("scroll", function () {
        t(this).scrollTop() > 200 ? t(".back2top").addClass("is-active") : t(".back2top").removeClass("is-active")
    }), t(document).on("click", ".back2top", function () {
        t("html,body").animate({scrollTop: 0}, 800)
    })
}(jQuery);